package com.ming.multifunction.model.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 帖子
 * @TableName post
 */
@TableName(value ="post")
@Data
public class Post implements Serializable {
    /**
     * 帖子id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * '帖子标题'
     */
    @TableField(value = "title")
    private String title;

    /**
     * '物品照片'
     */
    @TableField(value = "imageUrl")
    private String imageUrl;

    /**
     * '邮箱'
     */
    @TableField(value = "email")
    private String email;

    /**
     * '用户角色 0 - 普通用户 1 - 管理员'
     */
    @TableField(value = "userRole")
    private Integer userRole;

    /**
     * '是否已找到 0-寻找中 1-已找到'
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * '地址'
     */
    @TableField(value = "address")
    private String address;

    /**
     * '物品描述'
     */
    @TableField(value = "description")
    private String description;

    /**
     * '标签 json 列表'
     */
    @TableField(value = "tags")
    private String tags;

    /**
     * '物品丢失时间'
     */
    @TableField(value = "createTime")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date createTime;

    /**
     * '更新时间'
     */
    @TableField(value = "updateTime")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date updateTime;

    /**
     * '是否删除'
     */
    @TableField(value = "isDelete")
    private Integer isDelete;

    /**
     * '发布者ID'
     */
    @TableField(value = "userId")
    private Long userId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}